home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ccdl150l.zip
/
IO
/
TEST
/
SCFTST.C
< prev
Wrap
C/C++ Source or Header
|
1996-07-21
|
724b
|
27 lines
#include <stdio.h>
void main(void)
{
char buf[100];
short a;
int b,d,n,i;
char c;
i = SSCANF(" 20 -40 50a","%d %hd %n %d",&b,&a,&n,&d);
printf("%d %d %d %d %d\n",i,n,b,a,d);
i = SSCANF(" a bc"," %c %c",&buf[0],&buf[1]);
printf("%d %d %d\n",i,buf[0],buf[1]);
i = SSCANF("0778a"," %o",&b);
printf("%d %d\n",i,b);
i = SSCANF("778"," %u",&b);
printf("%d %d\n",i,b);
i = SSCANF("-778"," %u",&b);
printf("%d %d\n",i,b);
i = SSCANF("0xA2 7B","%x %x",&a,&b);
printf("%d %x %x\n",i,a,b);
i = SSCANF(" xxx abc"," %s",buf);
printf("%d %s\n",i,buf);
i = SSCANF(" abcdefg","%[ abc]",buf);
printf("%d %s\n",i,buf);
i = SSCANF(" abcdefghijk","%[^g]",buf);
printf("%d %s\n",i,buf);
}